print elements of array in java